<?
require_once('./lib/authentication.lib.php');
require_once('./lib/game.lib.php');

if (isset($_GET["game"]))
{
	$game_id = mysql_escape_string($_GET["game"]);

	$query = "SELECT Game.id game_id, Game.home, Game.away, Game.attendance, Game.home_pen, Game.away_pen, Referee.name referee_name, Referee.location referee_location, Stadium.name stadium_name FROM Game LEFT JOIN Referee ON Game.referee = Referee.id LEFT JOIN Stadium ON Game.stadium = Stadium.id WHERE Game.id = '$game_id';";
	$result_game = mysql_query($query);
	if ($row = mysql_fetch_assoc($result_game))
	{
		echo write_game_info($row);
	}
}
